<?php
class Jobprofile extends AppModel {
	var $name = 'Jobprofile';
	var $displayField = 'title';
	//The Associations below have been created with all possible keys, those that are not needed can be removed
var $virtualFields=array(
            //'display'=>'CONCAT(Jobprofile.title)'
        );
	var $hasAndBelongsToMany = array(
		'Securitygroup' => array(
			'className' => 'Securitygroup',
			'joinTable' => 'jobprofiles_securitygroups',
			'foreignKey' => 'jobprofile_id',
			'associationForeignKey' => 'securitygroup_id',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'Tool' => array(
			'className' => 'Tool',
			'joinTable' => 'jobprofiles_tools',
			'foreignKey' => 'jobprofile_id',
			'associationForeignKey' => 'tool_id',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'User' => array(
			'className' => 'User',
			'joinTable' => 'jobprofiles_users',
			'foreignKey' => 'jobprofile_id',
			'associationForeignKey' => 'user_id',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		)
	);

        function __construct($id = false, $table = null, $ds = null) {
            parent::__construct($id, $table, $ds);
            $this->virtualFields['display'] = sprintf('CONCAT(%s.title)',  $this->alias);
        }
        function getJobList(){
            return $this->find('list');
        }

}
?>